<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>商品管理 － 更新商品</title>
    <meta name="keywords" content="龙蛙商城">
    <meta name="description" content="龙蛙商城">

    <link rel="shortcut icon" href="/favicon.ico">
    <link href="/web/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/web/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/web/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="/web/css/animate.min.css" rel="stylesheet">
    <link href="/web/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="/web/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="/web/js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
    <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/ueditor/lang/zh-cn/zh-cn.js"></script>
    <style>
        .labelStyle {
            margin-left: 15px;
        }
    </style>
</head>
<body class="gray-bg" onload="load()">
<div class="wrapper wrapper-content  animated fadeInRight">
    <div class="row">
        <div class="col-md-12">
            <div class="ibox">
                <div class="ibox-content">
                    <div class="clients-list">
                        <ul class="nav nav-tabs">
                            <li class="active"><a data-toggle="tab" href="#tab-1"><i class="fa fa-user"></i>通用信息</a></li>
                            <li class=""><a data-toggle="tab" href="#tab-2"><i class="fa fa-briefcase"></i>详细描述</a></li>
                            <li class=""><a data-toggle="tab" href="#tab-4"><i class="fa fa-briefcase"></i>商品属性</a></li>
                            <li class=""><a data-toggle="tab" href="#tab-5"><i class="fa fa-briefcase"></i>商品相册</a></li>
                        </ul>
                        <div class="tab-content">
                            <div id="tab-1" class="tab-pane active">
                                <form id="ajaxform" class="form-horizontal" role="form">
                                    <input type="hidden" id="goodsId" name="goodsId" th:value="${goods.goodsId}">
                                    <input type="hidden" id="goodsPayType" name="goodsPayType"
                                           th:value="${goods.goodsPayType}">

                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">商品名称：</label>
                                        <div class="col-sm-10">
                                            <input type="text" name="goodsName" th:value="${goods.goodsName}"
                                                   class="form-control" required="" aria-required="true">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">商品货号：</label>
                                        <div class="col-sm-10">
                                            <input type="text" class="form-control" name="goodsSn" readonly="readonly"
                                                   th:value="${goods.goodsSn}">
                                            <span class="help-block m-b-none">如果您不输入商品货号，系统将自动生成一个唯一的货号。</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">商品分类：</label>
                                        <div class="col-sm-10">
                                            <select class="form-control" id="categoryId" name="categoryId">
                                                <option value="0">全部分类</option>
                                                <option value="110000" hassubinfo="true">生鲜</option>
                                                <option value="120000" hassubinfo="true">服装</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">商品品牌：</label>
                                        <div class="col-sm-10">
                                            <select class="form-control" id="goodsWeight" name="goodsWeight">
                                                <option value="0">全部品牌</option>
                                                <option value="110000" hassubinfo="true">地龙大王</option>
                                                <option value="120000" hassubinfo="true">品牌2</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">当前分类为：</label>
                                        <div class="col-sm-10">
                                            <input type="text" id="cateNmae" class="form-control" aria-required="true" readonly="readonly">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">当前分类名称为：</label>
                                        <div class="col-sm-10">
                                        <input type="text" id="categoryName" th:value="${categoryName}" class="form-control" aria-required="true" readonly="readonly">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <p style="color: red;margin-left: 119px;">如果需要更换分类，请在下方选择分类</p>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">请选择一级：</label>
                                        <div class="col-sm-10">
                                            <input type="hidden" id="cateId" name="cateId" th:value="${goods.cateId}">
                                            <select class="form-control" id="cateLevel1">
                                                <option value="0">选择分类</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">请选择二级：</label>
                                        <div class="col-sm-10">
                                            <select class="form-control" id="cateLevel2">
                                                <option value="0">选择分类</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">请选择三级：</label>
                                        <div class="col-sm-10">
                                            <select class="form-control" id="cateLevel3">
                                                <option value="0">选择分类</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">卖出价（单位:元）：</label>
                                        <div class="col-sm-10">
                                            <input class="form-control" name="goodsScreenPrice" id="goodsScreenPrice"
                                                   th:value="${goods.goodsScreenPrice}" type="number" required=""
                                                   aria-required="true" min="1" max="99999999">
                                            <span class="help-block m-b-none">网上标出的价格。</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">商品积分：</label>
                                        <div class="col-sm-10">
                                            <input class="form-control goodsScreenPrice" id="goodsScore"
                                                   th:value="${goods.goodsScore}" name="goodsScore" type="number"
                                                   required="" aria-required="true" min="1"
                                                   max="99999999">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">进货价（单位:元）：</label>
                                        <div class="col-sm-10">
                                            <input class="form-control" name="goodsRealPrice" id="goodsRealPrice"
                                                   th:value="${goods.goodsRealPrice}" type="number" required=""
                                                   aria-required="true" min="1" max="99999999">
                                            <span class="help-block m-b-none">实际进货价。</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">运费（单位:元）：</label>
                                        <div class="col-sm-10">
                                            <input class="form-control" name="goodsExPrice" id="goodsExPrice"
                                                   th:value="${goods.goodsExPrice}" type="number" required=""
                                                   aria-required="true" min="1" max="99999999">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">库存 ：</label>
                                        <div class="col-sm-10">
                                            <input class="form-control" name="goodsStock" type="number"
                                                   th:value="${goods.goodsStock}" required="" id="goodsStock"
                                                   aria-required="true" min="1" max="99999999">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">库存预警值 ：</label>
                                        <div class="col-sm-10">
                                            <input class="form-control" name="giveScore" type="number"
                                                   th:value="${goods.giveScore}" required="" id="giveScore"
                                                   aria-required="true" min="1" max="99999999">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">产地</label>
                                        <div class="col-sm-10">
                                            <input class="form-control" name="detaileDescription" type="text"
                                                   th:value="${goods.detaileDescription}" required="" id="detaileDescription">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label"></label>
                                        <input  id="goodsGetType" th:value="${goods.goodsGetType}" type="hidden">
                                        <div class="col-sm-10">
                                            <div class="radio i-checks">
                                                <label>
                                                    <input type="radio" name="goodsGetType" value="0" checked=""> <i></i> 进口 </label>
                                            </div>
                                            <div class="radio i-checks">
                                                <label>
                                                    <input type="radio" name="goodsGetType" value="1"> <i></i> 非进口 </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <div class="col-sm-5"></div>
                                        <button id="submitCategoryCreate" class="btn btn-primary col-sm-2">保存</button>
                                        <div class="col-sm-5"></div>
                                    </div>
                                </form>
                            </div>
                            <div id="tab-2" class="tab-pane">
                                <div>
                                    <script id="editor" type="text/plain"></script>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <div class="col-sm-5"></div>
                                    <button id="submitCategoryDetail" class="btn btn-primary col-sm-1">保存</button>
                                    <div class="col-sm-5"></div>
                                </div>
                            </div>
                            <div id="tab-4" class="tab-pane">
                                <form id="ajax-attr" class="form-horizontal" role="form">
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">商品类型：</label>
                                        <div class="col-sm-10">
                                            <select class="form-control" id="typeId" name="typeId"
                                                    onchange="getAttrList()" class="required">
                                                <option value="0">商品类型</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div id="attribute-list"></div>
                                    <div class="hr-line-dashed"></div>

                                    <div class="form-group">
                                        <div class="col-sm-5"></div>
                                        <button id="submitAttrLike" class="btn btn-primary col-sm-1">保存</button>
                                        <div class="col-sm-5"></div>
                                    </div>
                                </form>
                            </div>
                            <div id="tab-5" class="tab-pane">
                                <div class="ibox float-e-margins">
                                    <div class="ibox-content">
                                        <div th:each="goodsImage,iterStat : ${goodsAlbum}" th:remove="tag">
                                            <a class="fancybox" th:href="${goodsImage.url}">
                                                <img th:src="${goodsImage.url}"/>
                                                <button th:onclick="${'deleteImageForGoods(' + goodsImage.imageId + ', this)'}"
                                                        class="btn-primary">删除
                                                </button>
                                                <button th:onclick="${'setImageForGoods(' + goodsImage.imageId + ', this)'}"
                                                        class="btn-primary"
                                                        th:text="${goods.goodsThum eq goodsImage.url ? '默认封面' : '设为封面'}">
                                                    设为封面
                                                </button>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                                <div class="ibox float-e-margins">
                                    <script id="editorAlbum" type="text/plain"></script>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script th:inline="javascript">
    goodsCategoryIdChecked = [[${goods.categoryId}]];
    goodsDetailChecked = [[${goods.goodsDetail}]];
    goodsAttrLink = [[${attrbuteLink}]];
    goodsTypeIdChecked = [[${goodTypeId}]];
    rebateRatios=[[${rebateRatios}]];
    rebateRatio=[[${rebateRatio}]];
    goodsWeightHidden=[[${goods.goodsWeight}]];
</script>
<script src="/web/js/jquery.min.js?v=2.1.4"></script>
<script src="/web/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/web/js/content.min.js?v=1.0.0"></script>
<script src="/web/js/plugins/datapicker/bootstrap-datepicker.js"></script>
<script src="/web/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/web/js/plugins/validate/messages_zh.min.js"></script>
<script src="/web/js/plugins/toastr/toastr.min.js"></script>
<script src="/web/js/plugins/fancybox/jquery.fancybox.js"></script>
<script src="/web/js/self/goods_update.js?v=1.0"></script>
</body>
</html>
